using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace LS.Setting
{
    /// <summary>
    /// 应用设置
    /// </summary>
    [System.Serializable]
    public partial class ApplicationSetting
    {
        private GameplaySetting m_GamePlay;
        private VideoSetting m_Video;
        private AudioSetting m_Audio;

        /// <summary>
        /// 游戏设置
        /// </summary>
        public GameplaySetting GamePlay
        {
            get
            {
                return m_GamePlay;
            }
        }

        /// <summary>
        /// 视频设置
        /// </summary>
        public VideoSetting Video
        {
            get
            {
                return m_Video;
            }
        }

        /// <summary>
        /// 音频设置
        /// </summary>
        public AudioSetting Audio
        {
            get
            {
                return m_Audio;
            }
        }

        /// <summary>
        /// 是否存在已修改的设置
        /// </summary>
        public bool IsChanged
        {
            get
            {
                return m_GamePlay.IsValueChanged ||
                        m_Video.IsValueChanged ||
                        m_Audio.IsValueChanged;
            }
        }

        public ApplicationSetting()
        {
            m_GamePlay = new GameplaySetting();
            m_Video = new VideoSetting();
            m_Audio = new AudioSetting();
        }

        public void Load()
        {
            m_GamePlay.Load();
            m_Video.Load();
            m_Audio.Load();
        }

        public void Save()
        {
            m_GamePlay.Save();
            m_Video.Save();
            m_Audio.Save();
        }
    }
}
